import { defineStore } from "pinia";
import { RouteRecordRaw } from "vue-router";
import components from "./components";
import { useRepoStore } from "./repo";
import { rootActions, rootGetters, rootState } from "./types";
import { useUserStore } from "./user";


const state = (): rootState => {
    return {
        routes: []
    }
}

const actions: rootActions = {
    _initRoutes(routes: RouteRecordRaw[]) {
        this.routes = [...routes];
    }
}

const getters: rootGetters = {
}


const useRootStore = defineStore('root', {
    state,
    actions,
    getters,
});

export {
    components, useRepoStore, useRootStore,
    useUserStore
};

